from gironimo.imagequery import Format, register_format


class AccountAvatarFormat(Format):
    '''
        Crops the user avatar into 50x50 px
    '''
    def execute(self, query):
        return query.fit(50, 50).image_format('JPEG').query_name('account_avatar')


register_format('account_avatar', AccountAvatarFormat)

